package com.ssi.dao.good.impl;

import java.util.List;
import java.util.Map;

import com.ssi.common.CommonDao;
import com.ssi.dao.good.GoodsDao;
import com.ssi.domain.goods.Goods;

/**
 * 
 * 
 * @author 
 * @version 
 */
public class GoodsDaoImpl extends CommonDao implements GoodsDao {
	private  String addGoods = "goods.addGoods";
	private  String updateGoods = "goods.updateGoods";
	private  String deleteGoods = "goods.deleteGoods";
	private  String queryGoodsById = "goods.queryGoodsById";
	private  String queryGoodsByIds = "goods.queryGoodsByIds";	
	private  String queryGoodsByGoodstypeId = "goods.queryGoodsByGoodstypeId";
	private  String queryGoodsByName = "goods.queryGoodsByName";
	private  String queryGoods = "goods.queryGoods";
	private  String queryMoreGoods = "goods.queryMoreGoods";
	
	
	public void insertGoods(Goods goods) {		
		sqlSessionTemplate.insert(addGoods, goods);
	}
	public void updateGoods(Goods goods) {
		sqlSessionTemplate.insert(updateGoods, goods);
		
	}
	public void deleteGoods(int goodsId) {
		sqlSessionTemplate.insert(deleteGoods, goodsId);
		
	}
	public Goods queryGoodsById(int id) {
		return sqlSessionTemplate.selectOne(queryGoodsById,id);
	}
	public List<Goods> queryGoodsByIds(Map<String, Object> map) {
		return sqlSessionTemplate.selectOne(queryGoodsByIds,map);
	}
	public List<Goods> queryGoodsByGoodstypeId(Map<String, Object> map) {
		
		return sqlSessionTemplate.selectList(queryGoodsByGoodstypeId,map);
	}
	public List<Goods> queryGoodsByName(Map<String, Object> map) {
		return sqlSessionTemplate.selectList(queryGoodsByName,map);
	}
	public List<Goods> queryGoods(Map<String, Object> map) {
		return sqlSessionTemplate.selectList(queryGoods,map);
	}
	public List<Goods> queryMoreGoods(Map<String, Object> map) {
		return sqlSessionTemplate.selectList(queryMoreGoods,map);
	}
	public List<Goods> queryGoodsByShopId(int id) {
		return sqlSessionTemplate.selectList(queryMoreGoods,id);
	}
	






}
